package domo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-06-02
 * Time: 19:18
 */

class Solution {
    public int countSegments(String s) {
        int count = 0;
        for(int i = 0; i < s.length(); i++) {
            if(!Character.isLetter(s.charAt(i))) {
                count++;
            }
        }
        return count+1;
    }
}
public class Test4 {
    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.countSegments("Hello, my name is John"));
    }
}
